package cn.zhaozhiqi.controller.app;

import cn.zhaozhiqi.pojo.domain.DriverPoint;
import cn.zhaozhiqi.result.JSONResult;
import cn.zhaozhiqi.service.IDriverPointService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/app/order")
public class AppBigDataController {

    @Autowired
    private IDriverPointService driverPointService;



    @Operation( summary= "司机端实时存储位置到bigdata",description = "司机端实时存储位置到bigdata接口")
    @Parameter(name = "DriverPointDto",description = "实时司机经纬度和订单编号",required = true)
    @PostMapping("/save/location")
    public JSONResult saveLocation(@RequestBody @Valid DriverPoint point){
        driverPointService.save(point);
        return JSONResult.success();
    }



}
